package com.xianyun.site.support.gatewayimpl.database.domainobject;

import com.aliyuncs.dm.model.v20151123.SingleSendMailRequest;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xianyun.common.core.annotation.Excel;
import lombok.Data;

import java.util.Date;

/**
 * 邮件服务配置对象 smtp_config
 *
 * @author ruoyi
 * @date 2020-10-19
 */
@Data
public class SmtpConfig {
    private static final long serialVersionUID = 1L;

    /** 主键 */
    private Long id;

    /** 配置名称 */
    @Excel(name = "配置名称")
    private String configName;

    /** 账户名称 */
    @Excel(name = "账户名称")
    private String accountName;

    /** 发送人 */
    @Excel(name = "发送人")
    private String fromAlias;

    /** 发送地址 */
    @Excel(name = "发送地址")
    private String replyToAddress;

    /** 标签 */
    @Excel(name = "标签")
    private String tagName;

    /** 模板名称 */
    @Excel(name = "模板名称")
    private String templateName;

    /** 订阅 */
    @Excel(name = "订阅")
    private String subscribe;

    /** 0 简答发送 1 木办法 */
    @Excel(name = "0 简答发送 1 木办法")
    private String type;

    /** 创建者 */
    private String createBy;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /** 更新者 */
    private String updateBy;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /** 备注 */
    private String remark;

    public SingleSendMailRequest initNoReplyRequest(){
        SingleSendMailRequest request = new SingleSendMailRequest();
        request.setAccountName(accountName);
        request.setFromAlias(fromAlias);
        request.setTagName(tagName);
        request.setReplyToAddress(false);
        request.setClickTrace("0");
        request.setAddressType(0);
        return request;
    }
}
